﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Attendance.aspx.cs" Inherits="Basic4Net.OAWeb.Module_Attendance.Attendance" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="../Scripts/common.js"></script>
    <script type="text/javascript" src="../Scripts/Util.js"></script>
    <script language="javascript" type="text/javascript">
        function TypeAdd() {
            var btn = document.getElementById("btnBind");
            btn.click();
        }

        function OpenDIV(teacherid, teachname) {
            document.getElementById("hdf_TeacherID").value = teacherid;
            document.getElementById("span_TeachName").innerHTML = teachname;
            PageMethods.LoadAtt(teacherid,response);

            ShowPopForm("popTable", "formTitle", "记录考勤", "");
        }

        function response(result) {
            var Late = document.getElementById("txt_Late");
            var Early = document.getElementById("txt_Early");
            var Truant = document.getElementById("txt_Truant");
            var Absenteeism = document.getElementById("txt_Absenteeism");
            var Sick = document.getElementById("txt_Sick");
            var Leave = document.getElementById("txt_Leave");
            var Other = document.getElementById("txt_Other");
            var OtherContect = document.getElementById("txt_OtherContect");
            Late.value = result[0];
            Early.value = result[1];
            Truant.value = result[2];
            Absenteeism.value = result[3];
            Sick.value = result[4];
            Leave.value = result[5];
            Other.value = result[6];
            OtherContect.value = result[7];
        }

        function Attendance() {
//            var Late = document.getElementById("txt_Late");
//            var Early = document.getElementById("txt_Early");
//            var Truant = document.getElementById("txt_Truant");
//            var Absenteeism = document.getElementById("txt_Absenteeism");
//            var Sick = document.getElementById("txt_Sick");
//            var Leave = document.getElementById("txt_Leave");
//            var Other = document.getElementById("txt_Other");
//            var OtherContect = document.getElementById("txt_OtherContect");
            //            PageMethods.AddAtt(Late.value, Early.value, Truant.value, Absenteeism.value, Sick.value, Leave.value, Other.value, OtherContect.value);
            var btn = document.getElementById("btnBind2");
            btn.click();
            ClosePopForm('popTable', true);
        }

        function TopClick() {
            document.getElementById("txt_Go").value = 1;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = 1;
        }

        function UpClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) > 1) {
                txt.value = parseInt(txt.value) - 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function NextClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) < parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = parseInt(txt.value) + 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function EndClick() {
            document.getElementById("txt_Go").value = document.getElementById("lbl_PageCount").innerHTML;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }

        function GoClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) >= parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = document.getElementById("lbl_PageCount").innerHTML;
            }
            document.getElementById("btnBind").click();
            var patrn = /^[1-9]\d*$/;
            if (patrn.exec(txt.value)) {
                document.getElementById("lbl_ToPage").innerHTML = txt.value;
            } 

        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:HiddenField ID="hdf_TeacherID" runat="server" />
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div class="mainWarp">
            <div class="pageBody">

            <table style="width: 100%;">
            <tr>
                <td colspan="6" style="height:10px">
                </td>
            </tr>
            <tr>
                
                <td style="text-align:left;width:180px">
                    分类：
                    <asp:DropDownList ID="ddl_FType" runat="server"></asp:DropDownList>
                </td>
                <td style="text-align:left;width:180px">
                    工号：<asp:TextBox ID="txt_TeacherCode" runat="server" Width=100px></asp:TextBox>
                </td>
                <td style="text-align:left;width:180px">
                    姓名：<asp:TextBox ID="txt_TeacherName" runat="server" Width=100px></asp:TextBox>
                </td>
                <td style="text-align:left">
                    <input id="btn_Search" type="button" onclick="TypeAdd()" class="commonBut" 
                        value="搜索" />
                </td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td colspan="6" style="height:10px">
                </td>
            </tr>
            <tr>
                <td colspan="6" align="left">
                    
                
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                               <asp:Repeater ID="rpt_TeacherType" runat="server" >
                                <HeaderTemplate>
                                <table id="settingTable" style="width:60%" class="useList1" border="0" cellpadding="0" cellspacing="1">
                                    <tr  class="tableTitle">
<%--                                        <th>
                                            职务分类
                                        </th>--%>
                                        <th>
                                            工号
                                        </th>
                                        <th>
                                            姓名
                                        </th>
<%--                                        <th>
                                            性别
                                        </th>
                                        <th>
                                            年龄
                                        </th>--%>
                                        <th>

                                        </th>
                                    </tr>
                                </HeaderTemplate>
                            <ItemTemplate>
                            <tr >
<%--                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TypeName")%>
                                </td>--%>
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TeachCode")%>
                                </td>
                                <td style="text-align:left">
                                    <%# DataBinder.Eval(Container.DataItem, "TeachName")%>
                                </td>
<%--                                <td>
                                    <%# Basic4Net.Utility.Common.Common.GetSexy(DataBinder.Eval(Container.DataItem, "Sexy"))%>
                                </td>
                                <td>
                                    <%# Basic4Net.Utility.Common.Common.GetAge(DataBinder.Eval(Container.DataItem, "Birthday"))%>
                                </td>--%>
                                <td>
                                    <input id="btn_Commit" type="button" value="考勤" onclick='OpenDIV(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,&quot;<%# DataBinder.Eval(Container.DataItem, "TeachName").ToString()%>&quot;)' class="commonBut"/>
                                </td>
                            </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                            </asp:Repeater>
                    <div class="page" style="width:60%;margin-top:10px">
                    <span ><input id="lbnTop" type="button" value="首页" class="commonBut" onclick="TopClick()" /></span>
                    <span ><input id="lbnUp" type="button" value="上一页" class="commonBut" onclick="UpClick()" /></span>
                    <span ><input id="lbnNext" type="button" value="下一页" class="commonBut" onclick="NextClick()" /></span>
                    <span ><input id="lbnEnd" type="button" value="末页" class="commonBut" onclick="EndClick()" /></span>
                    <span class="disabled"><asp:Label ID="lbl_L_Di" runat="server" Text="第"></asp:Label> <asp:Label ID="lbl_ToPage" runat="server" Text="0"></asp:Label> / <asp:Label ID="lbl_PageCount" runat="server" Text="0"></asp:Label> <asp:Label ID="lbl_L_Yie" runat="server" Text="页"></asp:Label></span>
                    <span ><asp:Label ID="lbl_L_TD" runat="server" Text="跳到"></asp:Label><span class="shoppingnumber">
                                        <asp:TextBox ID="txt_Go" CssClass="logininput" Text="" runat="server" Width="50px"></asp:TextBox>
                                        <asp:regularexpressionvalidator id="REV_Go" runat="server" ErrorMessage="RegularExpressionValidator" Display="Dynamic"
					                        ControlToValidate="txt_Go" ValidationExpression="^[1-9]\d*$">*</asp:regularexpressionvalidator>
                                        </span><asp:Label ID="lbl_L_Yie2" runat="server" Text="页"></asp:Label></span>
                    <span ><input id="lbnGo" type="button" value="跳转" class="commonBut" onclick="GoClick()" /></span>
                    </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind"  EventName="Click" />
                    </Triggers>

                </asp:UpdatePanel>
                    


                </td>
            </tr>
            <tr>
                <td ></td>
                <td></td>
                <td  align="center" style="height:50px">
                    </td>
                 <td></td>
                <td ></td>
                <td></td>
            </tr>
        </table>

            <div style="display: none;">
                <asp:Button ID="btnBind" runat="server" OnClick="btnBind_Click" Text="btnBind" />
                <asp:Button ID="btnBind2" runat="server" OnClick="btnBind2_Click" Text="btnBind2" />
            </div>

            <div id="popTable" class="layoutWarp" style="display: none; width: 400px;overflow: inherit; ">
                <div class="title">
                    <span id="formTitle">记录考勤</span> <a title="关闭" onclick="ClosePopForm('popTable', true);">
                        关闭</a>
                </div>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                <table id="PTableInfo" style="width: 90%; margin-top: 12px;" border="0" class="layoutTable">
                        <tr>
                            <td colspan="6" align="left"><%=GetProDateStr() %>，教工为<span id="span_TeachName"></span></td>
                        </tr>
                        <tr>
                            <td style="height:50px;text-align:right;width:60px">迟到：</td>
                            <td style="text-align:left">
                                <asp:TextBox ID="txt_Late" Width="50px" runat="server" Text="0" style="text-align:right"></asp:TextBox>
                                <asp:regularexpressionvalidator id="REV_infoindex" runat="server" ControlToValidate="txt_Late" Display="Dynamic"
								ErrorMessage="RegularExpressionValidator" ValidationExpression="^(0?|[1-9]\d*)$">*</asp:regularexpressionvalidator>
                            </td>
                            <td style="width:50px;text-align:left">次</td>
                            <td style="text-align:right">早退：</td>
                            <td style="text-align:left">
                                <asp:TextBox ID="txt_Early" Width="50px" runat="server" Text="0" style="text-align:right"></asp:TextBox>
                                <asp:regularexpressionvalidator id="Regularexpressionvalidator1" runat="server" ControlToValidate="txt_Early" Display="Dynamic"
								ErrorMessage="RegularExpressionValidator" ValidationExpression="^(0?|[1-9]\d*)$">*</asp:regularexpressionvalidator>
                            </td>
                            <td style="width:50px;text-align:left">次</td>
                        </tr>

                        <tr>
                            <td style="height:50px;text-align:right">旷课：</td>
                            <td style="text-align:left">
                                <asp:TextBox ID="txt_Truant" Width="50px" runat="server" Text="0" style="text-align:right"></asp:TextBox>
                                <asp:regularexpressionvalidator id="Regularexpressionvalidator2" runat="server" ControlToValidate="txt_Truant" Display="Dynamic"
								ErrorMessage="RegularExpressionValidator" ValidationExpression="^(0?|[1-9]\d*)$">*</asp:regularexpressionvalidator>
                            </td>
                            <td style="text-align:left">节</td>
                            <td style="text-align:right">旷工：</td>
                            <td style="text-align:left">
                                <asp:TextBox ID="txt_Absenteeism" Width="50px" runat="server" Text="0" style="text-align:right"></asp:TextBox>
                                <asp:regularexpressionvalidator id="Regularexpressionvalidator3" runat="server" ControlToValidate="txt_Absenteeism" Display="Dynamic"
								ErrorMessage="RegularExpressionValidator" ValidationExpression="^(0?|[1-9]\d*)$">*</asp:regularexpressionvalidator>
                            </td>
                            <td style="text-align:left">天</td>
                        </tr>

                        <tr>
                            <td style="height:50px;text-align:right">病假：</td>
                            <td style="text-align:left">
                                <asp:TextBox ID="txt_Sick" Width="50px" runat="server" Text="0" style="text-align:right"></asp:TextBox>
                                <asp:regularexpressionvalidator id="Regularexpressionvalidator4" runat="server" ControlToValidate="txt_Sick" Display="Dynamic"
								ErrorMessage="RegularExpressionValidator" ValidationExpression="(\d+\.?\d*)">*</asp:regularexpressionvalidator>
                            </td>
                            <td style="text-align:left">天</td>
                            <td style="text-align:right">事假：</td>
                            <td style="text-align:left">
                                <asp:TextBox ID="txt_Leave" Width="50px" runat="server" Text="0" style="text-align:right"></asp:TextBox>
                                <asp:regularexpressionvalidator id="Regularexpressionvalidator6" runat="server" ControlToValidate="txt_Leave" Display="Dynamic"
								ErrorMessage="RegularExpressionValidator" ValidationExpression="(\d+\.?\d*)">*</asp:regularexpressionvalidator>
                            </td>
                            <td style="text-align:left">天</td>
                        </tr>
                        

                        <tr>
                            <td style="height:50px;text-align:right">其他违 &nbsp; <br />规扣点：</td>
                            <td style="text-align:left">
                                <asp:TextBox ID="txt_Other" Width="50px" runat="server" Text="0.0" style="text-align:right"></asp:TextBox>
                                <asp:regularexpressionvalidator id="REV_price" runat="server" ErrorMessage="RegularExpressionValidator" Display="Dynamic"
											ControlToValidate="txt_Other" ValidationExpression="(\d+\.?\d*)">*</asp:regularexpressionvalidator>
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>

                        <tr>
                            <td style="height:80px;text-align:right">描述：</td>
                            <td colspan="5" style="text-align:left">
                                <asp:TextBox ID="txt_OtherContect" Width="260px" Height="80px" 
                                    TextMode="MultiLine" runat="server" 
                                    ontextchanged="txt_OtherContect_TextChanged"></asp:TextBox>
                                <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="txt_OtherContect"
                        Display="Dynamic" ErrorMessage="RegularExpressionValidator" ValidationExpression="^[\u4e00-\u9fa5\w]+$">*</asp:RegularExpressionValidator>--%>
                            </td>
                        </tr>

                        <tr>
                            <td colspan="3" style="text-align:right">
                                <input id="btn_SetFType" onclick="Attendance()" type="button" value="记录考勤" class="commonBut" />
                            </td>
                            <td colspan="3" style="text-align:center">
                                <input id="btn_Exit" type="button" value="取消" onclick="javascript:ClosePopForm('popTable', true)" class="commonBut" />
                            </td>
                        </tr>
                 </table>
                 </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind2"  EventName="Click" />
                    </Triggers>

                </asp:UpdatePanel>
            </div>
                
            </div>
        </div>
    </form>
</body>
</html>
